package com.smartrobot.smartrobot.circle;


import android.content.Context;
import android.os.Handler;

import android.util.Log;
import com.smartrobot.smartrobot.Common.Common;
import com.smartrobot.smartrobot.Common.CommonFunc;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2014/12/24.
 */
public class searchAndAddFriend {

    private String userAccount;
    private String userId;
    private String meId;


    public static String post_user_account = "phone";
    public static String post_user_id = "u_or_id";//请求的参数名
    public static String post_search_friend_url = "/searchFriends";//请求的路径
    public static String post_add_friend_Or_join_url = "/addFriendsOrJoinSof";//请求的路径
    public static String post_add_circle_url = "/joinSof";//请求的路径
    public static String post_add_friend_url = "/addFriends";//请求的路径
    public static String post_add_friend_request = "/askToBeFriend";



    //查找用户
    public  void searchUser(final Handler handler,final Context context){
        Map<String,String> map = new HashMap<String, String>();
        map.put(post_user_account,userAccount);
        CommonFunc.c_http_post(false,map, Common.baseUrl + post_search_friend_url, "com.smartrobot.smartrobot.circle.searchAndAddFriendResponse", "searchFriendSuccess", "commonFail", handler, context);
    }

    //添加用户好友或者添加社交圈
    public void addFriendOrJoinCircle(final Handler handler,final Context context,Object object){
        Map<String,String> map = new HashMap<String, String>();
        map.put(post_user_id,userId);
        CommonFunc.c_http_post(false,map, Common.baseUrl + post_add_friend_Or_join_url, "com.smartrobot.smartrobot.circle.searchAndAddFriendResponse", "addFriendOrCircleSuccess", "commonFail", handler,context,object);
    }


    //加入社交圈
    public void addCircle(final Handler handler,final Context context,Object object){
        Map<String,String> map = new HashMap<String, String>();
        map.put(post_user_id,userId);
        CommonFunc.c_http_post(false,map, Common.baseUrl + post_add_circle_url, "com.smartrobot.smartrobot.circle.searchAndAddFriendResponse", "addCircleSuccess", "commonFail", handler,context,object);
    }

    //直接添加好友
    public void addFriend(final Handler handler,final Context context,Object object){
        Map<String,String> map = new HashMap<String, String>();
        map.put(post_user_id,userId);
        CommonFunc.c_http_post(false,map, Common.baseUrl + post_add_friend_url, "com.smartrobot.smartrobot.circle.searchAndAddFriendResponse", "addFriendSuccess", "commonFail", handler,context,object);
    }




    //发起添加好友的请求
    public void addFriendRequest(final Handler handler,final Context context){
        Map <String,String> map = new HashMap<String, String>();
        map.put(post_user_id,userId);
        Log.e("=====发起请求====","70");
        CommonFunc.c_http_post(false,map, Common.baseUrl + post_add_friend_request, "com.smartrobot.smartrobot.circle.searchAndAddFriendResponse", "addFriendRequestSuccess", "commonFail", handler,context);

    }














    public searchAndAddFriend(){

    }

    public searchAndAddFriend(String userAccount, String userId, String meId) {
        this.userAccount = userAccount;
        this.userId = userId;
        this.meId = meId;
    }
    public searchAndAddFriend(String userAccount) {

        this.userAccount = userAccount;
    }


    public String getUserAccount() {
        return userAccount;
    }

    public void setUserAccount(String userAccount) {
        this.userAccount = userAccount;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getMeId() {
        return meId;
    }

    public void setMeId(String meId) {
        this.meId = meId;
    }


}
